package com.gym.system.chat.service.impl;

import java.util.List;
import com.gym.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gym.system.chat.mapper.GymChatMapper;
import com.gym.system.chat.domain.GymChat;
import com.gym.system.chat.service.IGymChatService;
import com.gym.common.core.text.Convert;

/**
 * 评论Service业务层处理
 * 
 * @author administrator
 * @date 2021-04-11
 */
@Service
public class GymChatServiceImpl implements IGymChatService 
{
    @Autowired
    private GymChatMapper gymChatMapper;

    /**
     * 查询评论
     * 
     * @param id 评论ID
     * @return 评论
     */
    @Override
    public GymChat selectGymChatById(Long id)
    {
        return gymChatMapper.selectGymChatById(id);
    }

    /**
     * 查询评论列表
     * 
     * @param gymChat 评论
     * @return 评论
     */
    @Override
    public List<GymChat> selectGymChatList(GymChat gymChat)
    {
        return gymChatMapper.selectGymChatList(gymChat);
    }

    /**
     * 新增评论
     * 
     * @param gymChat 评论
     * @return 结果
     */
    @Override
    public int insertGymChat(GymChat gymChat)
    {
        gymChat.setCreateTime(DateUtils.getNowDate());
        return gymChatMapper.insertGymChat(gymChat);
    }

    /**
     * 修改评论
     * 
     * @param gymChat 评论
     * @return 结果
     */
    @Override
    public int updateGymChat(GymChat gymChat)
    {
        gymChat.setUpdateTime(DateUtils.getNowDate());
        return gymChatMapper.updateGymChat(gymChat);
    }

    /**
     * 删除评论对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGymChatByIds(String ids)
    {
        return gymChatMapper.deleteGymChatByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除评论信息
     * 
     * @param id 评论ID
     * @return 结果
     */
    @Override
    public int deleteGymChatById(Long id)
    {
        return gymChatMapper.deleteGymChatById(id);
    }
}
